package cn.juque.lucenecandy.core.config;

import cn.juque.lucenecandy.interceptor.CheckSignatureInterceptor;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author juque
 * @version 1.0.0
 * <ul>
 *     <li>LuceneCandyMvcConfig</li>
 * </ul>
 * @date 2023-12-27
 **/
@Configuration
@ComponentScans(value = {@ComponentScan("cn.hutool.extra.spring")})
public class LuceneCandyConfiguration implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 拦截器
        InterceptorRegistration apiRegistration = registry.addInterceptor(new CheckSignatureInterceptor());
        apiRegistration.addPathPatterns("/lucd/**");
    }
}
